.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px; /* Abstand zum Rand */
    box-sizing: border-box;
}

.lightbox-title {
    color: #fff !important; /* Weiß für bessere Lesbarkeit */
}

.lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center; /* Zentriert den Inhalt horizontal */
    max-width: 90%;
    max-height: 90vh; /* Begrenzung der maximalen Höhe relativ zur Ansichtshöhe */
    overflow: hidden;
    box-sizing: border-box;
}

.lightbox-header {
    position: absolute;
    top: 0;
    width: 100%; /* Nimmt die gesamte Breite des Containers ein */
    text-align: center;
    color: white;
    padding: 10px 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5); /* Hintergrund für bessere Lesbarkeit */
}

.lightbox-img-container {
    position: relative;
    display: inline-block; /* Passt die Breite an den Inhalt an */
    width: 600px; /* Ermöglicht automatische Breitenanpassung */
    max-width: 100%; /* Verhindert, dass der Container breiter als der sichtbare Bereich wird */
    max-height: 100%; /* Anpassung für Header, Thumbnails und Navigation */
    overflow: hidden;
    margin-top: 60px; /* Platz für den Header */
    margin-bottom: 20px; /* Platz für die Thumbnails */
    box-sizing: border-box;
}

.lightbox-img {
  width: 600px; /* Ermöglicht automatische Breitenanpassung */
  max-width: 100%; /* Verhindert, dass der Container breiter als der sichtbare Bereich wird */
  max-height: 100%;
    transition: transform 0.3s ease;
    cursor: zoom-in;
    border-radius: 10px;
    object-fit: contain; /* Verhindert Zuschneiden und Verzerrung */
}

.lightbox-hover-text {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.lightbox-img-container:hover .lightbox-hover-text {
    opacity: 1;
}

.lightbox-thumbnails {
    display: flex; /* Wechsel von grid zu flex für bessere Anpassung */
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 25px;
    max-width: 100%;
    overflow-x: auto; /* Ermöglicht horizontales Scrollen bei vielen Thumbnails */
    box-sizing: border-box;
}

.thumbnail {
    width: 30px;
    height: 30px; /* Einheitliche Größe der Thumbnails */
    object-fit: cover; /* Beibehaltung des Seitenverhältnisses */
    cursor: pointer;
    border-radius: 2px;
}

.current-thumbnail {
    border: 2px solid #F3DA65; /* Hervorhebung des aktuellen Thumbnails */
    opacity: 0.6;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 50px;
    cursor: pointer;
    color: white;
    z-index: 20;
}

.download-btn {
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 20px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    text-decoration: none;
    border-radius: 5px;
    z-index: 20;
}

.navigation {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.prev, .next {
    font-size: 30px;
    color: white;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    z-index: 1;
}

.prev:hover, .next:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/** FILTER **/

.filter-buttons {
    text-align: center;
    margin-bottom: 20px;
}

.filter-buttons button {
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    border: none;
    background-color: #ddd;
    border-radius: 5px;
}

.filter-buttons button.active {
    background-color: #333;
    color: white;
}

.gallery__item {
    display: block; /* a-Elemente als Block, um die volle Zelle zu füllen */
}

.gallery__item.active {
    display: block; /* Stelle sicher, dass aktive Elemente sichtbar sind */
}

.gallery__item.inactive {
    display: none; /* Deaktiviere nur nicht ausgewählte Bilder */
}

#mobile-filter-buttons {
    display: none;
}

@media screen and (max-width: 760px) {
    .filter-buttons {
        display: none;
    }

    #mobile-filter-buttons {
        display: block;
    }
}


@media screen and (max-width: 1200px) {

    .lightbox-thumbnails {

        display: flex;

        flex-wrap: wrap;

        justify-content: center;

        align-items: center;

        gap: 10px;

        margin-top: 25px;

        max-width: 100%;

        overflow-x: auto;

        box-sizing: border-box;

    }

}



@media screen and (max-width: 900px) {

    .lightbox-thumbnails {

        display: flex;

        flex-wrap: wrap;

        justify-content: center;

        align-items: center;

        gap: 10px;

        margin-top: 25px;

        max-width: 100%;

        overflow-x: auto;

        box-sizing: border-box;

    }



    .navigation {

        position: absolute;

        top: 30%;

        width: 100%;

        display: flex;

        justify-content: space-between;

        transform: translateY(-50%);

    }

}



@media screen and (max-width: 650px) {

    .lightbox-thumbnails {

        display: flex;

        flex-wrap: wrap;

        justify-content: center;

        align-items: center;

        gap: 10px;

        margin-top: 25px;

        max-width: 100%;

        overflow-x: auto;

        box-sizing: border-box;

    }



    .navigation {

        position: absolute;

        top: 40%;

        width: 100%;

        display: flex;

        justify-content: space-between;

        transform: translateY(-50%);

    }

}



@media screen and (max-width: 450px) {

    .lightbox-thumbnails {

        display: flex;

        flex-wrap: wrap;

        justify-content: center;

        align-items: center;

        gap: 10px;

        margin-top: 25px;

        max-width: 100%;

        overflow-x: auto;

        box-sizing: border-box;

    }



    .navigation {

        position: absolute;

        top: 35%;

        width: 100%;

        display: flex;

        justify-content: space-between;

        transform: translateY(-50%);

    }



    .filter-buttons {

        text-align: center;

        margin-bottom: 20px;

    }



    .filter-buttons button {

        padding: 10px 20px;

        margin: 5px;

        cursor: pointer;

        border: none;

        background-color: #ddd;

        border-radius: 5px;

    }

}



@media screen and (max-width: 360px) {

    .lightbox-thumbnails {

        display: flex;

        flex-wrap: wrap;

        justify-content: center;

        align-items: center;

        gap: 10px;

        margin-top: 25px;

        max-width: 100%;

        overflow-x: auto;

        box-sizing: border-box;

    }

}
